#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;
int main()
{
    int n, s = 0;
    cin >> n;
    for (; n > 0; n--)
    {
        for (int m = n; m > 0; )
        {
            if (m % 2 != 0)
            {
                m /= 10;
            }
            else
            {
                break;
            }

            if (m % 2 == 0)
            {
                m /= 10;
            }
            else
            {
                break;
            }

            if (m == 0)
            {
                s++;
            }
        }
    }
    cout << s;
    return 0;

}